package com.jt.www.common.controller;

import com.jt.www.admin.user.service.UserService;
import com.jt.www.exception.BizException;
import com.jt.www.model.entity.User;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.Resource;

public class BaseController {

    @Resource
    UserService userService;

    protected User getUser(String userCode) {
        if (StringUtils.isEmpty(userCode)) {
            throw new BizException("用户code为空");
        }
        return userService.findUserByCode(userCode);
    }

}
